package com.pri.chat.activity;

import android.content.Intent;
import android.widget.ImageView;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.netease.nim.uikit.net.SharedHelper;
import com.netease.nim.uikit.net.rxjava.HttpMethods;
import com.pri.chat.R;
import com.pri.chat.adapter.PlayGameAdapter;
import com.pri.chat.base.BaseActivity;
import com.pri.chat.base.TcWebActivity;
import com.pri.chat.bean.PlayGameBean;
import com.pri.chat.shake.TestActivity;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.vondear.rxtool.RxActivityTool;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * 描述：添加类的描述
 *
 * @author wx5e48d604c2885118
 * @time 2020/4/11
 */
public class PlayGameActivity extends BaseActivity {
    @BindView(R.id.rec_main)
    RecyclerView recMain;
    @BindView(R.id.none)
    ImageView none;
    @BindView(R.id.srl_all)
    SmartRefreshLayout srlAll;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_play_game_layout;
    }

    private List<PlayGameBean> mList;
    private PlayGameAdapter mAdapter;

    @Override
    protected void initView() {
        setTitle("游戏中心");
        mList=new ArrayList<>();
        mList.add(new PlayGameBean(R.mipmap.ic_luck_one,R.mipmap.ic_luck_right_one));
        mList.add(new PlayGameBean(R.mipmap.ic_luck_two,R.mipmap.ic_luck_right_two));
        mList.add(new PlayGameBean(R.mipmap.ic_luck_three,R.mipmap.ic_luck_right_three));
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
        recMain.setLayoutManager(linearLayoutManager);
        mAdapter = new PlayGameAdapter(R.layout.item_play_game, mList);
        recMain.setAdapter(mAdapter);
        mAdapter.setOnItemClickListener((adapter, view, position) -> {
            Intent intent=new Intent();
            switch (position){
                case 0:
                    intent.setClass(this, TcWebActivity.class);
                    intent.putExtra("url", HttpMethods.BASE_URL+"daZhuanPan.client?memberId="+ SharedHelper.readId(this));
                    startActivity(intent);
                    break;
                case 1:
                    RxActivityTool.skipActivity(this, TestActivity.class);
                    break;
                case 2:
                    intent.setClass(this, TcWebActivity.class);
                    intent.putExtra("url", HttpMethods.BASE_URL+"guaJiang.client?memberId="+ SharedHelper.readId(this));
                    startActivity(intent);
                    break;
                case 3:

                    break;
            }
        });
        srlAll.setEnableLoadmore(false);
        srlAll.setEnableRefresh(false);
    }

    @Override
    protected void initData() {

    }


}
